<template>
  <div class="nav-bar" :style="activeStyle">
    <div class="left">
      <slot name="left"></slot>
    </div>
    <div class="center">
      <slot name="center"></slot>
    </div>
    <div class="right">
      <slot name="right"></slot>
    </div>
  </div>
</template>


<script>
export default {
  name: 'NavBar',
  props: {
    color: {
      type: String,
      default() {
        return '#fff'
      }
    },
    backgroundColor: {
      type: String,
      default() {
        return '#ff8097'
      }
    }
  },
  computed: {
    activeStyle() {
      return 'color: ' + this.color + ';' +
        'background-color: '+ this.backgroundColor + ';'
    }
  }
}
</script>

<style lang="less" scoped>
.nav-bar {
  display: flex;
  width: 100vw;
  height: 46px;
  line-height: 46px;
  border-bottom: 2px solid rgba(100, 100, 100, .1);
  
  .left,.right {
    width: 60px;
    height: 100%;
  }

  .center {
    flex: 1;
    text-align: center;
  }
}
</style>